﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yto.Common.Dependency;
using Yto.Repositories;

namespace com.ytocargo.Core.Charts
{
    public class ChartStore : IChartStore, ITransient
    {
        private IBaseRepository<Chart, string> _baseRepository;

        public ChartStore(IBaseRepository<Chart, string> baseRepository)
        {
            _baseRepository = baseRepository;
        }

        public async Task<bool> BatchInsertAsync(List<Chart> charts)
        {
            return await _baseRepository.BatchInsertAsync(charts);
        }

        public async Task<bool> DeleteAllAsync()
        {
            return await _baseRepository.DeleteAllAsync();
        }

        public async Task DeleteAsync(Chart chart)
        {
            await _baseRepository.DeleteAsync(chart);
        }

        public async Task InsertAsync(Chart chart)
        {
            await _baseRepository.InsertAsync(chart);
        }

        public IQueryable<Chart> GetAll()
        {
            return _baseRepository.GetAll();
        }
    }
}
